<template>
    <div>
        <SevenCount :receiveCity="datafromInput"></SevenCount>
    <Searchinput @send-city="handleDataFromInput"></Searchinput>
    </div>
    </template>
    <script>
    import SevenCount from './SevenCount.vue';
    import Searchinput from './input.vue'; 
    export default{
        data(){
            return{
                datafromInput:''
            }
        },
        components:{
            // StackedLine
            SevenCount,
            Searchinput
        },
        methods:{
            handleDataFromInput(city){
                console.log('接收到的城市',city)
                this.datafromInput=city;
                console.log('父组件'+this.datafromInput),
                console.log('父组件更新后的 datafromInput:', this.datafromInput);
            }
        }
    }
    </script>